Imports ccapps.persistent.authorization
Imports System.Data.SqlClient

Namespace Web.page
    Public Class TTNETSinerjiUpdate
        Inherits [lib].BasePage

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub
        Protected WithEvents proc As System.Web.UI.HtmlControls.HtmlInputHidden
        Protected WithEvents Textbox1 As System.Web.UI.WebControls.TextBox
        Protected WithEvents txtNewMsisdn As System.Web.UI.WebControls.TextBox
        Protected WithEvents Lblok As System.Web.UI.WebControls.Label
        Protected WithEvents txtPstn As System.Web.UI.WebControls.TextBox
        Protected WithEvents txtMsisdn As System.Web.UI.WebControls.TextBox
        Protected WithEvents lbtnUpdate As System.Web.UI.WebControls.LinkButton

        'NOTE: The following placeholder declaration is required by the Web Form Designer.
        'Do not delete or move it.
        Private designerPlaceholderDeclaration As System.Object

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
            Me.PageTitle = "TTNET Sinerji Update"
            If Not IsPostBack Then
                Me.Initialize()
            End If
        End Sub

        Private Sub Initialize()
            ' Any initialization that is dependent on passed variables MUST be done in
            ' FillVars() and not here. Initialize() is called before the variables are passed!

            Me.txtPstn.Text = ""
            Me.txtMsisdn.Text = ""
            Me.txtNewMsisdn.Text = ""
            'Me.Lblok.Text = ""

        End Sub

        Private Sub lbtnUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbtnUpdate.Click

            If Me.txtPstn.Text = "" And Me.txtMsisdn.Text = "" Then
                Alert("Pstn veya Msisdn giriniz..!", Me)
                Return
            End If
            If Me.txtNewMsisdn.Text = "" Then
                Alert("Yeni Msisdn giriniz..!", Me)
                Return
            End If

            Dim result As String = persistent.TTNETSinerji.UpdateMsisdn(Me.txtPstn.Text, Me.txtMsisdn.Text, Me.txtNewMsisdn.Text, Session("user"))
            If result <> "" Then
                Me.Lblok.Text = result
                Return
            Else
                Me.Lblok.Text = "Update islemi basarili."
                Me.Initialize()
            End If
        End Sub
    End Class
End Namespace